//
//  UIBarButton+Extension.swift
//  WeiBo
//
//  Created by 陈贵 on 15/9/24.
//  Copyright © 2015年 hzj. All rights reserved.
//

import UIKit

extension UIBarButtonItem{
    convenience init(imageName: String, target: AnyObject?, actionName: String?){
        let button = UIButton(imageName: imageName)
        if target != nil && actionName != nil {
            button.addTarget(target, action: Selector(actionName!), forControlEvents: UIControlEvents.TouchUpInside)
        }
        self.init(customView:button)
    }
}
